
exports.__esModule = true;
exports.default = void 0;

const _utils = require('../utils');

const _relation = require('../mixins/relation');

const _constant = require('../utils/constant');

const _createNamespace = (0, _utils.createNamespace)('collapse');
const createComponent = _createNamespace[0];
const bem = _createNamespace[1];

const _default = createComponent({
  mixins: [(0, _relation.ParentMixin)('vanCollapse')],
  props: {
    accordion: Boolean,
    value: [String, Number, Array],
    border: {
      type: Boolean,
      default: true,
    },
  },
  methods: {
    switch: function _switch(name, expanded) {
      if (!this.accordion) {
        name = expanded ? this.value.concat(name) : this.value.filter((activeName) => activeName !== name);
      }

      this.$emit('change', name);
      this.$emit('input', name);
    },
  },
  render: function render() {
    let _ref;

    const h = arguments[0];
    return h('div', {
      class: [bem(), (_ref = {}, _ref[_constant.BORDER_TOP_BOTTOM] = this.border, _ref)],
    }, [this.slots()]);
  },
});

exports.default = _default;
